package transform.config;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

/**
 * This class represent a mapping between node difficult and the number of dependences 
 * that it make.
 *  
 * @author jarocena
 *
 */
public class Cost {
	
	private int nroDep = -1;
	private int highCost = 1;
	private int medCost = 1;
	private int lowCost = 1;
	
	public Cost() {
		
	}
	
	public int getNroDep() {
		return nroDep;
	}

	public void setNroDep(int nroDep) {
		this.nroDep = nroDep;
	}

	public int getHighCost() {
		return highCost;
	}

	public void setHighCost(int highCost) {
		this.highCost = highCost;
	}

	public int getMedCost() {
		return medCost;
	}

	public void setMedCost(int medCost) {
		this.medCost = medCost;
	}

	public int getLowCost() {
		return lowCost;
	}

	public void setLowCost(int lowCost) {
		this.lowCost = lowCost;
	}

	public Cost(int nroDep) {
		this.nroDep = nroDep;
	}
	
	public String toString(){
		return "<= " + this.getNroDep();
	}
	
	
	public static void main(String[] args) {
//		XMLEncoder e;
//		try {
//			e = new XMLEncoder(
//					new BufferedOutputStream(
//							new FileOutputStream("D:\\test01.xml")));
//			e.writeObject(new Cost(5));
//			e.close();
//		} catch (FileNotFoundException e1) {
//			// TODO Auto-generated catch block
//			e1.printStackTrace();
//		}
		System.out.println("start");
		Cost cost = new Cost(5);
		XStream xs = new XStream(new DomDriver());

	        //Write to a file in the file system
	        try {
	            FileOutputStream fs = new FileOutputStream("D:\\test02.xml");
	            xs.toXML(cost, fs);
	        } catch (FileNotFoundException e1) {
	            e1.printStackTrace();
	        }
	        
	       System.out.println("done");

		
	}

}
